#include<stdio.h>
int main(void)
{
	double fahight = 0;
	double mohight = 0;
	double chilehight = 0;
	double dpe = 0;
	double dfood = 0;
	int sex = 0;
	int pe = 0;
	int food = 0;

	printf("请输入父母体重\n");
	scanf_s("%lf %lf", &fahight, &mohight);

	printf("请输入孩子的性别(1 男 0 女）\n");
	scanf_s("%d", &sex);

	printf("请输入孩子是否有体育爱好（1喜欢 0不喜欢)\n");
	scanf_s("%d", &pe);
	
	printf("请输入孩子是否有良好饮食(1喜欢 0不喜欢)\n");
	scanf_s("%d", &food);

	if (sex == 1) 
	{
		chilehight = (fahight + mohight) * 0.54;
	}
	else if (sex == 0)
	{
		chilehight = (fahight * 0.923 + mohight) / 2;
	}
	if (pe == 1)
	{
		dpe = chilehight * 0.02;
	}
	if (food == 1)
	{
		dfood = chilehight * 0.015;
	}
	chilehight = chilehight + dpe + dfood;
	printf("%.3f", chilehight);
}